<template>
    <div class="mark-box">
      <!-- 首页-一键买币 -->
      <div class="onebuy">
        <div class="pur-back">
          <div class="pur-center flex">
            <div class="sdicon">
              <i class="iconfont icon-shandian"></i>
            </div>
            <div class="wit1">
              <h3 class="font-16">闪电交易 一键买币</h3>
              <p class="font-12">参考价{{Inputcoin.cny}} CNY/{{Inputcoin.coin}}</p>
            </div>
            <div class="wit2">
              <div class="flex coin_input" @click="showUL">
                <img :src="Inputcoin.logo" alt="" srcset="">
                <p>{{Inputcoin.coin}}</p> <P>{{Inputcoin.chinaname}}</P>
                <i class="iconfont icon-xiala" ></i>
              </div>
              <ul class="coin_select" v-show="listshow==true">
                <li v-for="(item,index) in options" :key="index" @click="setList(item)">
                  <img :src="item.logo" alt="" srcset="">
                  <p>{{item.coin}}</p> <P>{{item.chinaname}}</P>
                </li>
              </ul>
            </div>
            <div class="wit3">
              <el-input placeholder="请输入内容" v-model="input4" size="small">
                  <template slot="append">CNY</template>
              </el-input>
              
            </div>
            <div class="wit4">
              <el-button type="warning"  size="small" @click="navigateTo('/FrTrade/c2cTrade')">一键买币</el-button>
            </div>
          </div>
        </div>
      </div>
      <!-- 币种列表 -->
			<ul class="flex mark_price">
				<li v-for="(item,i) in listdata" :key='i' class="chat_li"  @click="toTrad(item)">
					<div class="flex flex-between ">
						<p class="font-14 coinname">{{item.chinaname}} {{item.tradcoin}}/{{item.maincoin}}</p>
            <p
                :class="item.rise<0?'color-danger':'color-success'"
                v-text="item.rise*1<0?item.rise*1+'%':'+'+item.rise*1+'%'"
              >
              </p>
					</div>
					<div class="m-top-15">
						<p class="price"><em class="font-20 ">{{Number(item.price)*1}}</em>
            <em class="mpcolor">≈ {{Number(item.cny).toFixed(2)}} CNY</em>
            </p>
					</div>
          <div class="m-top-15">
            <p class="mpcolor">24H量  <span class="m-left-10">{{Number(item.volume)}} </span></p>
          </div>
          <div class="chartbox">
            <template>
              <svg xmlns="http://www.w3.org/2000/svg"  width="100" height="80"><polyline  :points="svgData[i].rows " style="stroke: rgb(189, 201, 255); stroke-width: 1; fill: none;"></polyline></svg>
            </template>
          </div>
				</li>
			</ul>
      <!-- <notice-bar @onNewsLoad='onNewsLoad'></notice-bar> -->
      <notice-bar ></notice-bar>
      <!-- 交易数量 -->
      <div class="sys_info">
        <!-- 平台优势 -->
  <div class="trans-bar content ys_bg ">
        <div class="ysinfo_temp">
          <div class="down_infotitle">
            <div class="terrace_tips">
              <p>星空交易全球站，近24小时成交量 <em>{{TransAllData|NumFormat}}</em> 美元</p>
              <p class="do_title">为全球超过130个国家的数千万用户提供安全、可信赖的数字资产交易及资产管理服务</p>
            </div> 
          </div>
          <div class="m-top-40" >
            <el-row type="flex" class="row-bg" justify="space-between">
              <el-col :span="8" v-for="(item,index) in bottomData" :key="index" :md="8" :lg="8">
                <div class="infodata_box" >
                  <div  class="info_both">
                    <div class="img_back">
                      <img :src="item.imgs" alt="" srcset="">
                    </div>
                    <h3>{{item.title}}</h3>
                    <p>{{item.info}}</p>
                    <p>{{item.pinfo}}</p>
                  </div>
                </div>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
      </div>
    </div>
</template>
<script>
import newsModel from "@/model/newsModel.js";
import noticeBar from "@/components/home/NoticeBar.vue";
import AdVantageIntro from "@/components/home/AdvantageIntro.vue";
let { newsList } = newsModel;
let ajaxDone = true;
export default {
  name: "marketData",
  components: {
    noticeBar,
    AdVantageIntro
  },
  data() {
    return {
      noticeItem: null,
      listdata:
        [{"number":"3387.76","low":"9129.9700","tradcoin":"BTC","prise":"9426.0000","decimals":"2","tradgas":"0.00050000","state":"1","maincoin":"USDT","rise":"2.93","height":"9441.6700","cny":"66924.6000"},{"number":"84053.31","low":"180.3700","tradcoin":"ETH","prise":"186.5500","decimals":"2","tradgas":"0.00050000","state":"1","maincoin":"USDT","rise":"2.93","height":"187.2700","cny":"1324.5050"},{"number":"4954275.61","low":"0.0382","tradcoin":"POLA","prise":"0.0386","decimals":"6","tradgas":"0E-8","state":"1","maincoin":"USDT","rise":"0.64","height":"0.0387","cny":"0.2744"},{"number":"81682.13","low":"57.8800","tradcoin":"LTC","prise":"62.5400","decimals":"2","tradgas":"0.00050000","state":"1","maincoin":"USDT","rise":"7.35","height":"62.5600","cny":"444.0340"},{"number":"12806340.26","low":"0.2898","tradcoin":"XRP","prise":"0.3008","decimals":"4","tradgas":"0E-8","state":"1","maincoin":"USDT","rise":"3.62","height":"0.3035","cny":"2.1357"},{"number":"189469686.84","low":"0.0025","tradcoin":"DOGE","prise":"0.0026","decimals":"6","tradgas":"0.00050000","state":"1","maincoin":"USDT","rise":"1.04","height":"0.0026","cny":"0.0184"},
        // {"number":"0.00","low":"0.0000","tradcoin":"ATE","prise":"0.0000","decimals":"5","tradgas":"0E-8","state":"0","maincoin":"USDT","rise":"0.00","height":"0.0000","cny":"0.0500"},
      ],
      coinname:'',
      input4:'',
      options: [],
      Inputcoin:{},
      listshow:false,
      svgData:[
        {rows:'0 4.194543628870617 0.8928571428571429 4.30216680817407 1.7857142857142858 4.573395829214117 2.678571428571429 4.526950379356193 3.5714285714285716 4.736303826128079 4.464285714285714 4.620228970640102 5.357142857142858 4 6.250000000000001 5.400031790708566 7.142857142857144 5.096236677948472 8.035714285714286 5.046457080604948 8.928571428571429 5.089878536231698 9.821428571428571 5.001484858705807 10.714285714285714 4.523073463675232 11.607142857142856 4.560757084094176 12.499999999999998 4.333259671935392 13.39285714285714 4.966902770831643 14.285714285714283 4.476860628758185 15.178571428571425 4.980084284146887 16.07142857142857 6.206042560780334 16.96428571428571 7.229625838867635 17.857142857142854 7.023916692835833 18.749999999999996 7.1878326878268535 19.64285714285714 7.31150629804951 20.53571428571428 7.060514776864112 21.428571428571423 7.357098826457618 22.321428571428566 8.075801455394132 23.214285714285708 8.756665387284487 24.10714285714285 9.542981425696967 24.999999999999993 11.034508426476233 25.892857142857135 12.991032694029922 26.785714285714278 16.02882874500363 27.67857142857142 16.858023470847527 28.571428571428562 16.405820025820255 29.464285714285705 17.08575349794716 30.357142857142847 17.170968104614694 31.24999999999999 16.958513125298026 32.14285714285713 16.359297037648727 33.03571428571428 16.81948692897877 33.92857142857142 19.910086571527145 34.82142857142857 21.32678909966388 35.714285714285715 21.15938388055999 36.60714285714286 20.898777608485798 37.50000000000001 21.64593679852058 38.39285714285715 20.43440064822031 39.2857142857143 19.248374603100743 40.178571428571445 19.733686908043424 41.07142857142859 20.19945955795406 41.96428571428574 19.95071664786363 42.85714285714288 19.12741483385478 43.75000000000003 19.157267084598164 44.642857142857174 18.10739831819398 45.53571428571432 17.609137114876876 46.428571428571466 19.266983798369367 47.32142857142861 21.010587856724694 48.21428571428576 21.63973373343102 49.107142857142904 20.11478771948189 50.00000000000005 19.309629870859936 50.892857142857196 19.227904488305278 51.78571428571434 20.175655295672964 52.67857142857149 19.887290307323106 53.57142857142863 19.633972636729137 54.46428571428578 19.584890884208157 55.357142857142925 19.64692153510353 56.25000000000007 19.65374490670203 57.14285714285722 19.365379918352144 58.03571428571436 19.305597878551737 58.92857142857151 19.41779581835875 59.821428571428655 19.85588729030733 60.7142857142858 20.011351609113852 61.60714285714295 20.99275404459228 62.50000000000009 22.0023804262281 63.39285714285724 21.899487084055394 64.28571428571438 22.244455041347305 65.17857142857152 23.38636178601752 66.07142857142865 23.946188410348274 66.9642857142858 24 67.85714285714293 20.043762624206686 68.75000000000007 17.090793488332423 69.64285714285721 15.781093832990226 70.53571428571435 16.409464326560368 71.42857142857149 16.3111457448912 72.32142857142863 16.483358339439473 73.21428571428577 16.289512555391433 74.1071428571429 16.367050869010647'},
        {rows:'0 4.824896887889031 0.8928571428571429 4.742407199100119 1.7857142857142858 5.199850018747673 2.678571428571429 4.892388451443567 3.5714285714285716 5.702287214098223 4.464285714285714 4 5.357142857142858 7.704536932883386 6.250000000000001 12.563929508811405 7.142857142857144 11.529058867641556 8.035714285714286 11.64154480689913 8.928571428571429 11.469066366704142 9.821428571428571 11.101612298462666 10.714285714285714 8.604424446944119 11.607142857142856 7.989501312335951 12.499999999999998 6.504686914135712 13.39285714285714 7.547056617922771 14.285714285714283 6.467191601049883 15.178571428571425 7.742032245969259 16.07142857142857 8.85939257592802 16.96428571428571 9.924259467566534 17.857142857142854 9.061867266591673 18.749999999999996 9.294338207724033 19.64285714285714 9.354330708661404 20.53571428571428 8.68691413573303 21.428571428571423 9.459317585301815 22.321428571428566 10.216722909636307 23.214285714285708 11.109111361079876 24.10714285714285 12.48893888263966 24.999999999999993 15.946006749156354 25.892857142857135 19.575553055867992 26.785714285714278 21.832770903637016 27.67857142857142 20.145481814773124 28.571428571428562 19.478065241844753 29.464285714285705 20.752905886764125 30.357142857142847 20.940382452193447 31.24999999999999 19.515560554930623 32.14285714285713 17.295838020247473 33.03571428571428 17.550806149231335 33.92857142857142 19.8830146231721 34.82142857142857 23.70003749531306 35.714285714285715 23.58005249343832 36.60714285714286 22.740157480314956 37.50000000000001 24 38.39285714285715 21.51031121109862 39.2857142857143 19.890513685789266 40.178571428571445 20.55793025871764 41.07142857142859 21.51031121109862 41.96428571428574 20.19797525309337 42.85714285714288 18.40569928758903 43.75000000000003 19.22309711286089 44.642857142857174 17.528308961379835 45.53571428571432 16.770903637045343 46.428571428571466 17.70828646419195 47.32142857142861 17.80577427821523 48.21428571428576 18.225721784776873 49.107142857142904 15.751031121109866 50.00000000000005 14.266216722909629 50.892857142857196 14.003749531308562 51.78571428571434 15.31608548931381 52.67857142857149 14.941132358455167 53.57142857142863 12.391451068616416 54.46428571428578 9.346831646044238 55.357142857142925 9.849268841394831 56.25000000000007 10.134233220847396 57.14285714285722 10.239220097487806 58.03571428571436 10.97412823397076 58.92857142857151 11.176602924634413 59.821428571428655 14.243719535058132 60.7142857142858 13.23134608173978 61.60714285714295 14.438695163104619 62.50000000000009 15.968503937007853 63.39285714285724 15.991001124859393 64.28571428571438 15.66104236970379 65.17857142857152 17.460817397825256 66.07142857142865 17.09336332958378 66.9642857142858 17.49831271091113 67.85714285714293 12.548931383577031 68.75000000000007 8.784401949756274 69.64285714285721 4.562429696287964 70.53571428571435 6.339707536557933 71.42857142857149 6.3022122234720594 72.32142857142863 6.849643794525692 73.21428571428577 7.059617547806511 74.1071428571429 7.352080989876241'},
        {rows:'0 5.942362152257181 0.8928571428571429 6.045643844744291 1.7857142857142858 6.7419623521572625 2.678571428571429 6.145593869731782 3.5714285714285716 6.23888055972015 4.464285714285714 4 5.357142857142858 6.818590704647652 6.250000000000001 9.577211394302854 7.142857142857144 8.794269531900714 8.035714285714286 8.914209561885727 8.928571428571429 8.617691154422795 9.821428571428571 8.264534399466921 10.714285714285714 6.975179077128088 11.607142857142856 6.3155089122105394 12.499999999999998 6.122272197234718 13.39285714285714 7.115109112110621 14.285714285714283 5.589205397301344 15.178571428571425 8.54772613693153 16.07142857142857 9.557221389305333 16.96428571428571 9.660503081792443 17.857142857142854 8.987506246876574 18.749999999999996 9.000832916874895 19.64285714285714 9.393969681825737 20.53571428571428 8.990837914376154 21.428571428571423 11.276361819090468 22.321428571428566 12.81226053639845 23.214285714285708 12.878893886390134 24.10714285714285 13.085457271364316 24.999999999999993 13.581875728802267 25.892857142857135 15.65750458104282 26.785714285714278 16.96351824087956 27.67857142857142 17.7631184407796 28.571428571428562 18.799267033150088 29.464285714285705 19.44561052806931 30.357142857142847 19.279027153090134 31.24999999999999 18.65600533066801 32.14285714285713 18.87589538564051 33.03571428571428 18.789272030651343 33.92857142857142 20.70831251041146 34.82142857142857 23.61019490254874 35.714285714285715 24 36.60714285714286 23.800099950024983 37.50000000000001 23.70681326003665 38.39285714285715 22.63401632517074 39.2857142857143 21.124770947859403 40.178571428571445 20.751624187906046 41.07142857142859 20.781609195402307 41.96428571428574 21.19140429785109 42.85714285714288 19.45560553056805 43.75000000000003 19.642178910544715 44.642857142857174 18.289521905713812 45.53571428571432 17.60986173579878 46.428571428571466 18.74596035315676 47.32142857142861 19.578877228052647 48.21428571428576 20.02198900549727 49.107142857142904 18.392803598200885 50.00000000000005 17.02348825587208 50.892857142857196 17.130101615858734 51.78571428571434 18.05963684824253 52.67857142857149 17.533233383308357 53.57142857142863 17.523238380809612 54.46428571428578 15.204397801099454 55.357142857142925 15.24770947859404 56.25000000000007 14.258204231217718 57.14285714285722 13.411960686323509 58.03571428571436 13.661835748792276 58.92857142857151 13.671830751291017 59.821428571428655 16.083958020989506 60.7142857142858 17.210061635848742 61.60714285714295 17.949691820756296 62.50000000000009 18.56605030817926 63.39285714285724 18.729302015658817 64.28571428571438 18.319506913210077 65.17857142857152 20.59503581542561 66.07142857142865 20.61835748792271 66.9642857142858 20.228552390471414 67.85714285714293 18.469431950691312 68.75000000000007 14.56471764117939 69.64285714285721 11.3696485090788 70.53571428571435 13.098783941362639 71.42857142857149 12.712310511410958 72.32142857142863 13.038813926370151 73.21428571428577 12.259203731467592 74.1071428571429 12.798933866400127 '},
        {rows:'0 6.009097801364669 0.8928571428571429 7.297952994692942 1.7857142857142858 7.927217589082646 2.678571428571429 6.797573919636102 3.5714285714285716 8.260803639120551 4.464285714285714 10.300227445034118 5.357142857142858 13.340409401061432 6.250000000000001 18.78392721758908 7.142857142857144 16.198635329795295 8.035714285714286 15.463229719484483 8.928571428571429 15.539044730856727 9.821428571428571 15.402577710386655 10.714285714285714 12.43062926459441 11.607142857142856 11.460197119029559 12.499999999999998 10.868840030325995 13.39285714285714 11.422289613343455 14.285714285714283 5.273692191053824 15.178571428571425 7.31311599696739 16.07142857142857 9.686125852918895 16.96428571428571 12.27899924184989 17.857142857142854 10.53525398028809 18.749999999999996 10.16376042456408 19.64285714285714 10.497346474601983 20.53571428571428 8.776345716451875 21.428571428571423 9.708870356330552 22.321428571428566 10.891584533737683 23.214285714285708 11.59666413949963 24.10714285714285 12.69598180439728 24.999999999999993 14.758150113722536 25.892857142857135 16.350265352539815 26.785714285714278 17.47990902198636 27.67857142857142 16.38059135708871 28.571428571428562 15.425322213798344 29.464285714285705 17.313115996967426 30.357142857142847 16.676269901440477 31.24999999999999 16.28961334344202 32.14285714285713 15.918119787717977 33.03571428571428 16.228961334344227 33.92857142857142 20.884003032600475 34.82142857142857 24 35.714285714285715 22.00606520090978 36.60714285714286 20.15617892342684 37.50000000000001 21.08112206216831 38.39285714285715 18.579226686884006 39.2857142857143 16.638362395754374 40.178571428571445 17.35102350265353 41.07142857142859 17.343442001516323 41.96428571428574 17.404094010614116 42.85714285714288 15.622441243366211 43.75000000000003 16.009097801364668 44.642857142857174 14.030326004548897 45.53571428571432 14.068233510235036 46.428571428571466 15.228203184230479 47.32142857142861 15.88779378316908 48.21428571428576 16.03184230477636 49.107142857142904 14.500379075056873 50.00000000000005 13.317664897649742 50.892857142857196 13.438968915845331 51.78571428571434 14.78089461713419 52.67857142857149 14.765731614859742 53.57142857142863 13.85595147839272 54.46428571428578 9.269143290371506 55.357142857142925 10.080363912054594 56.25000000000007 9.443517816527683 57.14285714285722 8.38210765731614 58.03571428571436 7.646702047005295 58.92857142857151 7.75284306292647 59.821428571428655 12.271417740712682 60.7142857142858 10.952236542835479 61.60714285714295 12.27899924184989 62.50000000000009 13.469294920394228 63.39285714285724 13.059893858984081 64.28571428571438 12.95375284306294 65.17857142857152 15.910538286580737 66.07142857142865 15.463229719484483 66.9642857142858 16.024260803639116 67.85714285714293 11.983320697498122 68.75000000000007 9.08718726307809 69.64285714285721 4 70.53571428571435 6.676269901440479 71.42857142857149 6.774829416224412 72.32142857142863 6.865807429871104 73.21428571428577 7.214556482183491 74.1071428571429 7.343442001516288'},
        {rows:'0 15.5 0 15.5 2.962962962962963 13.071075401730525 5.925925925925926 12.932014833127333 8.88888888888889 13.525339925834352 11.851851851851851 13.562422744128563 14.814814814814813 12.422126081582228 17.77777777777778 9.55747836835599 20.74074074074074 11.884425216316446 23.703703703703702 12.227441285537719 26.666666666666664 9.872682323856626 29.629629629629626 1.7978986402966726 32.59259259259259 5.802843016069247 35.55555555555556 2.9567367119901142 38.51851851851852 0.5 41.48148148148148 4.940667490729295 44.44444444444444 0.657601977750339 47.407407407407405 3.132880098887517 50.37037037037037 3.067985166872708 53.33333333333333 6.4054388133498374 56.29629629629629 8.50061804697157 59.25925925925925 5.95117428924601 62.22222222222222 9.316440049443779 65.18518518518518 8.797280593325102 68.14814814814814 7.694066749072937 71.11111111111111 10.169344870210157 74.07407407407408 9.631644004944373 77.03703703703704 8.454264524103827 80 11.096415327564916 80 15.5'},
        {rows:'0 15.5 0 11.396137982752155 2.962962962962963 13.460879890013729 5.925925925925926 10.608736407948975 8.88888888888889 8.138420197475293 11.851851851851851 9.671978502687162 14.814814814814813 10.119422572178454 17.77777777777778 7.09042619672541 20.74074074074074 8.940194975628042 23.703703703703702 3.5233720784901568 26.666666666666664 5.078802649668797 29.629629629629626 0.5 32.59259259259259 5.185664291963503 35.55555555555556 6.76109236345456 38.51851851851852 3.404636920384929 41.48148148148148 8.270903637045349 44.44444444444444 7.547244094488167 47.407407407407405 12.533495813023338 50.37037037037037 12.959067616547905 53.33333333333333 15.5 56.29629629629629 13.518372703412053 59.25925925925925 13.28777652793397 62.22222222222222 12.777215348081466 65.18518518518518 14.01706036745404 68.14814814814814 11.477377827771514 71.11111111111111 13.196537932758401 74.07407407407408 6.04805649293837 77.03703703703704 6.091801024871867 80 10.85808023996999 80 15.5'},
        {rows:'0 4.646651270207855 0.8928571428571429 4.862201693610473 1.7857142857142858 5.632024634334106 2.678571428571429 4.492686682063114 3.5714285714285716 5.139337952270969 4.464285714285714 4 5.357142857142858 4.877598152424931 6.250000000000001 8.43418013856812 7.142857142857144 7.972286374133922 8.035714285714286 8.37259430331024 8.928571428571429 8.772902232486516 9.821428571428571 8.480369515011539 10.714285714285714 7.910700538876043 11.607142857142856 7.510392609699768 12.499999999999998 7.571978444957647 13.39285714285714 8.37259430331024 14.285714285714283 7.418013856812928 15.178571428571425 11.513471901462651 16.07142857142857 13.730561970746711 16.96428571428571 13.77675134719013 17.857142857142854 12.344880677444163 18.749999999999996 11.436489607390271 19.64285714285714 11.75981524249421 20.53571428571428 9.881447267128546 21.428571428571423 10.250962278675903 22.321428571428566 11.251732101616636 23.214285714285708 10.897613548883736 24.10714285714285 12.206312548113903 24.999999999999993 12.252501924557324 25.892857142857135 13.94611239414935 26.785714285714278 16.10161662817549 27.67857142857142 15.039260969976878 28.571428571428562 14.993071593533458 29.464285714285705 15.454965357967655 30.357142857142847 15.301000769822938 31.24999999999999 15.439568899153198 32.14285714285713 16.501924557351806 33.03571428571428 19.842956120092353 33.92857142857142 21.59815242494226 34.82142857142857 22.198614318706674 35.714285714285715 21.52117013086988 36.60714285714286 21.167051578137023 37.50000000000001 22.244803695150093 38.39285714285715 24 39.2857142857143 19.688991531947636 40.178571428571445 18.42648190916089 41.07142857142859 18.226327944572752 41.96428571428574 17.856812933025395 42.85714285714288 16.363356428021547 43.75000000000003 16.532717474980725 44.642857142857174 15.347190146266357 45.53571428571432 15.454965357967655 46.428571428571466 16.917628945342543 47.32142857142861 17.641262509622756 48.21428571428576 17.394919168591194 49.107142857142904 15.562740569668954 50.00000000000005 15.1008468052348 50.892857142857196 14.762124711316403 51.78571428571434 15.593533487297915 52.67857142857149 15.023864511162419 53.57142857142863 15.224018475750556 54.46428571428578 10.8206312548114 55.357142857142925 9.973826020015384 56.25000000000007 9.758275596612789 57.14285714285722 8.357197844495738 58.03571428571436 7.941493456505004 58.92857142857151 8.541955350269417 59.821428571428655 10.481909160893002 60.7142857142858 9.943033102386423 61.60714285714295 11.898383371824467 62.50000000000009 13.607390300230954 63.39285714285724 14.392609699769045 64.28571428571438 15.331793687451855 65.17857142857152 17.19476520400306 66.07142857142865 16.02463433410315 66.9642857142858 15.208622016936099 67.85714285714293 12.314087759815244 68.75000000000007 9.38876058506543 69.64285714285721 8.41878367975366 70.53571428571435 9.43494996150885 71.42857142857149 8.865280985373357 72.32142857142863 8.665127020785217 73.21428571428577 8.449576597382578 74.1071428571429 8.665127020785217'},
        
      ],
      tradlink:'',
      // 总计
      TransAllData:'',
			bottomData:[
				{imgs:require("../../assets/images/home/a11.png"),title:'高流动性',info:'全球化交易所无国界',pinfo:'范围广 高流动',},
				{imgs:require("../../assets/images/home/a12.png"),title:'系统可靠',info:'专业级高速撮合引擎GSLB',pinfo:'分布式集群技术',},
				{imgs:require("../../assets/images/home/a13.png"),title:'专属服务',info:'7*24小時在线客服',pinfo:'VIP大客户经理私人定制',},
			],
      bottomDataTwo:[
				{imgs:require("../../assets/images/home/Advantage_Default_04.png"),title:'多元化',info:'提供币币交易、承兑交易',pinfo:'陆续开放多元化交易',},
				{imgs:require("../../assets/images/home/Advantage_Default_05.png"),title:'安全保障',info:'冷存储，SSL，多重加密',pinfo:'银行级别安全技术',},
				{imgs:require("../../assets/images/home/Advantage_Default_06.png"),title:'方便快捷',info:'用户至上，响应快速及时',pinfo:'高水准用户体验',},
			],
      
      // 
      websocket:null,
      mainCoinArr:[],

    };
  },
  filters: {
		// NumFormat(){
		// Vue.filter('NumFormat', function(value) {
		NumFormat: (value) => {		
		if(!value) return '0.00';
			var intPart = Number(value).toFixed(0); //获取整数部分
			var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); //将整数部分逢三一断
			var floatPart = ".00"; //预定义小数部分
			var value2Array = value.split(".");
			//=2表示数据有小数位
			if(value2Array.length == 2) {
				floatPart = value2Array[1].toString(); //拿到小数部分
				if(floatPart.length == 1) { //补0,实际上用不着
					return intPartFormat + "." + floatPart + '0';
				} else {
					return intPartFormat + "." + floatPart;
				}
			} else {
				return intPartFormat + floatPart;
			}
		}
  },
  computed:{
    marketSocketData(){
      return this.$store.state.marketSocketData
    }
  },
  watch:{
    marketSocketData(data){
      data.overview&&this.processData(data);
    }
  },
  created() {
    // const area=1;
    // this.getmaincoin(area);
    if(this.marketSocketData.overview){
      this.processData(this.marketSocketData)
    }else{
      this.overview();
    }
  },
  mounted() {
    // this.overview();
    this.onebuylist();
    // this.volume();
  },
  methods: {
    getNewsList() {
      this.request(this.api.notices,{
        pagesize:1,
        pagecode:6,
      }).then(res => {
        console.log(`公告列表:${JSON.stringify(res)}`);
        if (res && res.code == "0") {
          res.data && res.data.list && (newsModel.newsList = res.data[0]);
          // this.noticeItem = newsModel.newsList.slice(0, 6);
          // this.$emit("onNewsLoad", newsModel.newsList);
        } else {
          this.getDataFaild(res.msg);
        }
      });
    },
    // 查看主要交易币种的信息 gettradcoininfo
    overview(){
      this.request(this.api.overview).then(res => {
        this.processData(res.data);
      });
    },
    // 查看快捷买币 币种列表 一键买币
    onebuylist(){
      this.request(this.api.currencylist).then(res => {
        console.log(`主要币种:${JSON.stringify(res)}`);
        this.options=res.data;
        this.Inputcoin=res.data[0];
      });
    },
    // 选择
    showUL(){
      this.listshow=true;
    },
    setList(item){
      this.Inputcoin=item;
      this.listshow=false;
    },
    // volume(){
    //   this.request(this.api.volume).then(res => {
    //     if (res.code == "0") {
    //       this.TransAllData = res.data[0].volume || "";
    //       this.initWebSocket();
    //     } else {
    //       this.errMsg(res.msg || "操作失败");
    //     }
    //   });
    // },
    toTrad(item){
      console.log(item);
      this.tradlink ='currency_trade?maincoinid='+item.maincoin+'&coinid='+item.tradcoin+'&areaid=main';
      this.navigateTo(this.tradlink);
      // this.tradlink =`${this.api.baseURL}/`+'currency_trade?maincoinid='+item.maincoin+'&coinid='+item.tradcoin+'&areaid=main';
      // window.location.href=this.tradlink;
    },
    //加工行情数据
    processData(coinInfo){
      let coinData=coinInfo.overview;
      this.listdata = coinData;
      // 全局 累计交易量
      this.TransAllData=coinInfo.volume[0].volume;
    },
  }
};
</script>
<style lang="scss" scoped>

.txt-pbold{color: $txt-pbold}
.mark-box{
  box-sizing: border-box;min-height: 120px;margin:0px auto;overflow: hidden;
  .mark_price{
    margin: 0 0px;cursor: pointer;
    li{width: 16%;
      flex: 1;
      padding: 18px 24px;
      height: 84px;
      transition: all .2s;
      position: relative;
    }
    li:last-of-type {
      border-left: none;
    }
    li:after {
        content: "";
        position: absolute;
        border-style: 1px solid;
        right: 1px;
        top: 18px;
        bottom: 18px;
    }
  }
}
// 一键买币
.onebuy{margin-bottom: 0px;}
.pur-back{
    width: 100%;
    height: 64px;
    text-align: center;
}
.pur-back .pur-center {
    text-align: center;
    width: 828px;
    height: 64px;
    margin: 0 auto;
    align-items:center ;
    p{color: #869ec9;line-height: 14px;margin-top: 8px;}
}
.wit1{width: 150px;}
.wit2{
  width: 150px;margin: 0 15PX;position: relative;
  p{margin-top: 0;margin-left: 5px;font-size: 12px;}
  img{width: 20px;height: 20px;border-radius: 50%;background: #869ec9;}
  .coin_input{
    align-items: center;background:#fff;height: 32px;padding-left:10px;border-radius:4px;
    cursor: pointer;
    i{position: absolute;top:8px;right: 5px;}
    p{margin-top: 0;color: #1c242c;}
  }
  .coin_select{
    position: absolute;z-index: 99;background:#fff;width: 100%;margin-top:3px;border-radius:2px;
    li{
      display: flex;margin:5px 0 5px 0px;cursor: pointer;
      p{margin-top: 0;line-height: 20px;color: #1c242c;}
      img{margin-left: 10px;}
      &:hover{background: #eeeeee;}
    }
  }
}
.wit3{width: 300px;}
.wit4{width: 150px;}
.line24{line-height: 18px;}
.m-top-5{margin-top: 5px;}
.chat_li{position: relative;}
.chartbox{
  width: 100px;height: 50px;position: absolute;right: -10px;top: 62px;
  svg{}
}
.sdicon{
  i{font-size: 26px;color: #2c7afe;}
}
.sys_info{padding-bottom: 90px;padding-top: 68px;background:url('~@/assets/images/images/images/bg1.gif');}

// 总数
.terrace_tips {
  text-align: center;
  padding-top: 0px;
  margin-bottom: 60px;
  p {
    height: 40px;
		line-height: 40px;
		font-size: 30px;
    margin-bottom: 20px;
	}
	em{
		background-image: -webkit-gradient(linear,left top,left bottom,from(#185dd3),to(#061d79));
    background-image: -o-linear-gradient(top,#185dd3,#061d79);
    background-image: linear-gradient(180deg,#185dd3,#061d79);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 5px;
    color: #185dd3;
	}
	.do_title {
		font-size: 16px;
  }
}
// infodata_box
.infodata_box{
  background: white;
	text-align: center;cursor: pointer;
	img{width: 78px;display: block;margin: 0 auto;}
	.img_back{width: 78px;display: block;margin: 0 auto;padding: 0px;}
	.info_both{
    // border: 1px solid #f2f2fc;
    box-shadow:0 0 12px 10px  #f2f2fc;
    
		width: 305px;height:270px;margin: 0 auto;transition: all 0.1s;
		text-align: center;border-radius:4px;padding:30px 15px 0 15px;
		h3{font-size:18px;line-height: 70px;color:#0a4bc1, }
		p{color: #54748f;font-size: 14px;line-height: 20px;}
	}
	&:hover{
		.info_both{
			background:#357ce1;box-shadow: 5px 5px 10px 0 #357ce1;
			transform: translateX(-10px);
			h3{color: #ffffff;}
			p{color: #ffffff;}
		}
	}	
}
.m-top-40{margin-top: 40px;}
</style>